﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Police/Police.master" StylesheetTheme="Content"
    EnableSessionState="True" AutoEventWireup="true" CodeFile="ProblemNew.aspx.cs"
    Inherits="Police_Question_ProblemNew" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <script type="text/javascript">
        function PopWin() {
            document.getElementById("ctl00$ContentPlaceHolder1$hidvalue").value = "";
            document.getElementById("ctl00$ContentPlaceHolder1$txtProblem").style.display = "none";
            document.getElementById("ctl00$ContentPlaceHolder1$lstProblem").style.display = "block";
            document.getElementById("ctl00_ContentPlaceHolder1_lblanswer").style.display = "none";
            document.getElementById("ctl00_ContentPlaceHolder1_rbtnSingle").style.display = "none";
            document.getElementById("ctl00_ContentPlaceHolder1_rbtnMutile").style.display = "none";
            document.getElementById("ctl00_ContentPlaceHolder1_txtAnswer").style.display = "none";
            document.getElementById("ctl00_ContentPlaceHolder1_txtGuardCount").style.display = "none";
            //            document.getElementById("ctl00_ContentPlaceHolder1_ckbright").style.display = "none";
            document.getElementById("ctl00_ContentPlaceHolder1_txtMark").style.display = "none";
            document.getElementById("ctl00_ContentPlaceHolder1_lblAnswerlist").style.display = "none";
            document.getElementById("ctl00_ContentPlaceHolder1_btnRemove").style.display = "none";
            document.getElementById("ctl00_ContentPlaceHolder1_Label2").style.display = "none";
            document.getElementById("ctl00_ContentPlaceHolder1_Label3").style.display = "none";
            document.getElementById("ctl00_ContentPlaceHolder1_Label4").style.display = "none";

            //            document.getElementById("ctl00_ContentPlaceHolder1_Label1").style.display = "none";
            document.getElementById("ctl00_ContentPlaceHolder1_lblGuardCount").style.display = "none";
            document.getElementById("ctl00_ContentPlaceHolder1_lblbai").style.display = "none";
            document.getElementById("ctl00_ContentPlaceHolder1_btnAddAnswer").style.display = "none";
            document.getElementById("ctl00_ContentPlaceHolder1_lblMark").style.display = "none";
            document.getElementById("ctl00_ContentPlaceHolder1_lstAnswer").style.display = "none";
            document.getElementById("ctl00_ContentPlaceHolder1_dptAnswer").style.display = "none";
            var Strs = window.showModalDialog("ProblemHistory.aspx");
            if (Strs != null && Strs.length > 2 && Strs != "") {
                var ReturnStr, StrID, StrText;
                ReturnStr = Strs.split("*");
                document.getElementById("ctl00$ContentPlaceHolder1$hidvalue").value = ReturnStr[0];
                document.getElementById("ctl00$ContentPlaceHolder1$hidFlag").value = ReturnStr[2];
                StrID = ReturnStr[0].split("|");

                StrText = ReturnStr[1].split("|");
                for (var i = 0; i < StrID.length; i++) {
                    document.getElementById("ctl00$ContentPlaceHolder1$lstProblem").options.add(new Option(StrText[i], StrID[i]));
                }

            }
            else {

                document.getElementById("ctl00$ContentPlaceHolder1$hidvalue").value = "";
                document.getElementById("ctl00$ContentPlaceHolder1$txtProblem").style.display = "";
                document.getElementById("ctl00$ContentPlaceHolder1$lstProblem").style.display = "";
                document.getElementById("ctl00_ContentPlaceHolder1_lblanswer").style.display = "";
                document.getElementById("ctl00_ContentPlaceHolder1_rbtnSingle").style.display = "";
                document.getElementById("ctl00_ContentPlaceHolder1_rbtnMutile").style.display = "";
                document.getElementById("ctl00_ContentPlaceHolder1_txtAnswer").style.display = "";
                document.getElementById("ctl00_ContentPlaceHolder1_txtGuardCount").style.display = "";
                //            document.getElementById("ctl00_ContentPlaceHolder1_ckbright").style.display = "none";
                document.getElementById("ctl00_ContentPlaceHolder1_txtMark").style.display = "";
                document.getElementById("ctl00_ContentPlaceHolder1_lblAnswerlist").style.display = "";
                document.getElementById("ctl00_ContentPlaceHolder1_btnRemove").style.display = "";
                document.getElementById("ctl00_ContentPlaceHolder1_Label2").style.display = "";
                document.getElementById("ctl00_ContentPlaceHolder1_Label3").style.display = "";
                document.getElementById("ctl00_ContentPlaceHolder1_Label4").style.display = "";

                //            document.getElementById("ctl00_ContentPlaceHolder1_Label1").style.display = "none";
                document.getElementById("ctl00_ContentPlaceHolder1_lblGuardCount").style.display = "";
                document.getElementById("ctl00_ContentPlaceHolder1_lblbai").style.display = "";
                document.getElementById("ctl00_ContentPlaceHolder1_btnAddAnswer").style.display = "";
                document.getElementById("ctl00_ContentPlaceHolder1_lblMark").style.display = "";
                document.getElementById("ctl00_ContentPlaceHolder1_lstAnswer").style.display = "";
                document.getElementById("ctl00_ContentPlaceHolder1_dptAnswer").style.display = "";

            }


        }
       
    </script>

    <style type="text/css">
        .vs
        {
            display: none;
        }
    </style>
    <table class="intable" cellpadding="0" cellspacing="0" width="770px" border="0">
        <caption>
            <span>添加问题</span>
        </caption>
        <tr>
            <td class="style1">
                问题所属分类：
            </td>
            <td class="style2">
                <asp:DropDownList ID="dptSubject" Width="405px" runat="server">
                </asp:DropDownList>
            </td>
            <td class="style2">
            </td>
        </tr>
        <tr>
            <td>
                问题：
            </td>
            <td>
                <asp:TextBox ID="txtProblem" runat="server" Width="400px" MaxLength="200" 
                    Rows="6" TextMode="MultiLine"></asp:TextBox>
                <asp:ListBox ID="lstProblem" Width="400" Visible="true" CssClass="vs" Height="100"
                    runat="server"></asp:ListBox>
                <a onclick="PopWin()" href="#">添加现有问题</a>
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblGuardCount" runat="server" Text="警戒线："></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtGuardCount" Width="180px" runat="server"></asp:TextBox>
                <asp:Label ID="lblbai" runat="server" Text="%"></asp:Label>
                </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblanswer" runat="server" Text="设置答案："></asp:Label>
                &nbsp;
            </td>
            <td>
                <asp:TextBox ID="txtAnswer" runat="server" Enabled="false" Width="180px"></asp:TextBox>
                <asp:RadioButton ID="rbtnSingle" GroupName="Answer" runat="server" AutoPostBack="True"
                    OnCheckedChanged="rbtnMutile_CheckedChanged" />
                <asp:Label ID="Label2" runat="server" Text="单选"></asp:Label>
                <asp:RadioButton ID="rbtnMutile" GroupName="Answer" runat="server" Text="" AutoPostBack="True"
                    OnCheckedChanged="rbtnMutile_CheckedChanged" />
                <asp:Label ID="Label3" runat="server" Text="多选"></asp:Label>
                &nbsp;
                <asp:CheckBox ID="ckbright" runat="server" Visible="false" Text="" /><asp:Label ID="Label1" Visible="false"  runat="server"
                    Text="设为正确答案"></asp:Label>
                <br />
                <asp:TextBox ID="txtMark" runat="server" Width="180" Text="0"></asp:TextBox> 
                <asp:Label ID="lblMark" runat="server" Text="(答案分数)说明：要扣除的分数，例1+1=2是否正确?回答是(扣0分),回答否(扣1分) "></asp:Label>
                &nbsp;</td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="Label4" runat="server" Text="序号："></asp:Label>
            </td>
            <td>
                <asp:DropDownList
                    ID="dptAnswer" Width="187px" runat="server">
                </asp:DropDownList>
                <asp:Button ID="btnAddAnswer" runat="server" Text="添加答案" OnClick="btnAddAnswer_Click"
                    Width="74px" />
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblAnswerlist" runat="server" Text="答案列表："></asp:Label>
            </td>
            <td>
                <table border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td>
                            <asp:ListBox ID="lstAnswer" Width="405px" Height="80" runat="server" 
                                SelectionMode="Multiple" AutoPostBack="True" 
                                onselectedindexchanged="lstAnswer_SelectedIndexChanged">
                            </asp:ListBox>
                        </td>
                        <td valign="bottom">
                            <div style="height: 15px;">
                                &nbsp;</div>
                        </td>
                    </tr>
                    <tr>
                        <td align="right" style="margin:0;padding:0;">
                            <asp:Button ID="btnRemove" runat="server" Text="移除选择项>>" 
                                OnClick="btnRemove_Click" Width="97px" />
                        </td>
                        <td valign="bottom">
                            &nbsp;</td>
                    </tr>
                </table>
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblRemark" runat="server" Text="备注："></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtRemark" Width="400" Height="40" runat="server" TextMode="MultiLine"></asp:TextBox>
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;
            </td>
            <td>
                <asp:Button ID="btnAdd" runat="server" Text="添 加" OnClick="btnAdd_Click" />
                &nbsp;<asp:Button ID="btnparent" runat="server" Text="返 回" 
                    onclick="btnparent_Click" />
                <asp:Label ID="lblPrompt" runat="server" ForeColor="Red"></asp:Label>
                <asp:HiddenField ID="hidvalue" runat="server" />
                <asp:HiddenField ID="hidFlag" runat="server" />
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
    </table>
</asp:Content>
